Release 10.1A: OpenEdge Development:
Java Open Clients
Example of extending proxy objects
For the Java client, ProxyGen generates two class files for each object. One contains the implementation, and the other is a delegating class that just calls this implementation class. The Java client code accesses the delegating classes. The delegating classes are created so the Java client is not exposed to implementation details of the proxy. These delegating classes are available for inheritance in Java while the implementation classes are final and cannot be extended.
Caution: Direct editing of any delegating class generated by ProxyGen is not supported. To modify a delegating class, you must extend (subclass) it.For example, if we have an
AccountAppObject and aTaxSubAppObject, ProxyGen generates the implementation classesAccountImpl.javaandTaxImpl.javaand the delegating classesAccount.javaandTax.java.Example 6–1 is a skeleton of the
Accountdelegating class.
Note the
protectedmember variablem_accountImpl. If a SubAppObject or a ProcObject is created, this variable must be passed to its constructor.Example 6–2 shows the constructor in the
Taxclass.
The member variables are
protectedrather thanprivate, to allow a Java client to extend these classes.Example 6–3 shows how a client might extend the
AccountandTaxclasses.
Note: To extend a SubAppObject or ProcObject, you also must extend the associated AppObject.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |